Ch.9 Linear Maps as Matrices

Return to TOC

Representing Linear Maps as Matrices

Recall that a linear map h:VWh:V\to W can be extended linearly from the action on the basis.
We can represent the transformation by a matrix.

Example 9.1

Let V=P2V=\mathcal{P}_2 and W=R2W=\mathbb{R}^2 with the bases
BV={1,1+x,1+x+x2}BW={(20),(11)}\begin{array}{cc}B_V=\{1,1+x,1+x+x^2\}&B_W=\{\begin{pmatrix}2\\0\end{pmatrix},\begin{pmatrix}-1\\1\end{pmatrix}\}\end{array}
Let h:P2R2h:\mathcal{P}_2\to\mathbb{R}^2 have this action on BVB_V
h(1)=(01)h(1+x)=(32)h(1+x+x2)=(21)\begin{array}{ccc}h(1)=\begin{pmatrix}0\\1\end{pmatrix}&h(1+x)=\begin{pmatrix}3\\2\end{pmatrix}&h(1+x+x^2)=\begin{pmatrix}-2\\-1\end{pmatrix}\end{array}
Note that these coordinates are under E2\mathcal{E}_2, not BWB_W
So, next we find the representation of these in terms of BWB_W
h(1)=(01)=1/2(20)+1(11)h(1+x)=(32)=5/2(20)+2(11)h(1+x+x2)=(21)=3/2(20)1(11)\begin{array}{rrr}h(1)=&\begin{pmatrix}0\\1\end{pmatrix}=&1/2\begin{pmatrix}2\\0\end{pmatrix}+1\begin{pmatrix}-1\\1\end{pmatrix}\\ h(1+x)=&\begin{pmatrix}3\\2\end{pmatrix}=&5/2\begin{pmatrix}2\\0\end{pmatrix}+2\begin{pmatrix}-1\\1\end{pmatrix}\\ h(1+x+x^2)=&\begin{pmatrix}-2\\-1\end{pmatrix}=&-3/2\begin{pmatrix}2\\0\end{pmatrix}-1\begin{pmatrix}-1\\1\end{pmatrix} \end{array}
So we have
RepBW(h(1))=(1/21)RepBW(h(1+x))=(5/22)RepBW(h(1+x+x2))=(3/21)\begin{array}{rcl}\text{Rep}_{B_W}(h(1))&=&\begin{pmatrix}1/2\\1\end{pmatrix}\\ \text{Rep}_{B_W}(h(1+x))&=&\begin{pmatrix}5/2\\2\end{pmatrix}\\ \text{Rep}_{B_W}(h(1+x+x^2))&=&\begin{pmatrix}-3/2\\-1\end{pmatrix}\end{array}
Concatenate these into one matrix
(1/25/23/2121)\begin{pmatrix}1/2&5/2&-3/2\\1&2&-1\end{pmatrix}
This is the matrix representation of hh with respect to BVB_V, BWB_W

If we have a vector in the domain v=c1β1+c2β2+c3β3\vec{v}=c_1\cdot\vec{\beta}_1+c_2\cdot\vec{\beta}_2+c_3\cdot\vec{\beta}_3 and apply the transformation,
h(c1β1+c2β2+c3β3)=c1h(β1)+c2h(β2)+c3h(β3)=c1(1/2(20)+1(11))+c2(5/2(20)+2(11))+c3(3/2(20)1(11))\begin{array}{rcl}h(c_1\cdot\vec{\beta}_1+c_2\cdot\vec{\beta}_2+c_3\cdot\vec{\beta}_3)&=&c_1\cdot h(\vec{\beta}_1)+c_2\cdot h(\vec{\beta}_2)+c_3\cdot h(\vec{\beta}_3)\\ &=&c_1\cdot(1/2\cdot\begin{pmatrix}2\\0\end{pmatrix}+1\cdot\begin{pmatrix}-1\\1\end{pmatrix})\\ &&+c_2\cdot(5/2\cdot\begin{pmatrix}2\\0\end{pmatrix}+2\cdot\begin{pmatrix}-1\\1\end{pmatrix})\\ &&+c_3\cdot(-3/2\begin{pmatrix}2\\0\end{pmatrix}-1\begin{pmatrix}-1\\1\end{pmatrix})\end{array}
This can be regrouped to
=(1/2c1+5/2c23/2c3)(20)+(1c1+2c21c3)(11)=(1/2c_1+5/2c_2-3/2c_3)\cdot\begin{pmatrix}2\\0\end{pmatrix}+(1c_1+2c_2-1c_3)\cdot\begin{pmatrix}-1\\1\end{pmatrix}
So the coordinate representation of h(v)h(\vec{v}) is
RepBW(h(v))=(1/2c1+5/2c23/2c31c1+2c21c3)=(1/25/23/2121)BV,BW(c1c2c3)BV\text{Rep}_{B_W}(h(\vec{v}))=\begin{pmatrix}1/2c_1+5/2c_2-3/2c_3\\1c_1+2c_2-1c_3\end{pmatrix}=\begin{pmatrix}1/2&5/2&-3/2\\1&2&-1\end{pmatrix}_{B_V,B_W}\begin{pmatrix}c_1\\c_2\\c_3\end{pmatrix}_{B_V}
The computation is performed by taking the dot product of the rows of the matrix with the column representing the input

Suppose that VV and WW are vector spaces with dimensions nn and mm with bases B=β1,β2,...,βnB=\langle\vec{\beta}_1,\vec{\beta}_2,...,\vec{\beta}_n\rangle and DD and h:VWh:V\to W is a linear map. If
RepD(h(β1))=(h1,1h2,1hm,1)...RepD(h(βn))=(h1,nh2,nhm,n)\begin{array}{ccc}\text{Rep}_D(h(\vec{\beta}_1))=\begin{pmatrix}h_{1,1}\\h_{2,1}\\\vdots\\h_{m,1}\end{pmatrix}&...&\text{Rep}_D(h(\vec{\beta}_n))=\begin{pmatrix}h_{1,n}\\h_{2,n}\\\vdots\\h_{m,n}\end{pmatrix}\end{array}
then
RepB,D(h)=(h1,1h1,2h1,nh2,1h2,2h2,nhm,1h2,mhm,n)\text{Rep}_{B,D}(h)=\begin{pmatrix}h_{1,1}&h_{1,2}&\cdots&h_{1,n}\\h_{2,1}&h_{2,2}&\cdots&h_{2,n}\\\vdots&\vdots&&\vdots\\h_{m,1}&h_{2,m}&\cdots&h_{m,n}\end{pmatrix}
is the matrix representation of hh with respect to BB and DD
(Note the subscripts for the column vectors/matrix were omitted)

The matrix-vector product of an m×nm\times n matrix and a n×1n\times1 vector is defined as the following
(a1,1a1,2a1,na2,1a2,2a2,nam,1a2,mam,n)(c1cn)=(c1a1,1++cna1,nc2a2,1++cna2,ncnam,1++cnam,n)\begin{pmatrix}a_{1,1}&a_{1,2}&\cdots&a_{1,n}\\a_{2,1}&a_{2,2}&\cdots&a_{2,n}\\\vdots&\vdots&&\vdots\\a_{m,1}&a_{2,m}&\cdots&a_{m,n}\end{pmatrix}\begin{pmatrix}c_1\\\vdots\\c_n\end{pmatrix}=\begin{pmatrix}c_1a_{1,1}+\cdots+c_na_{1,n}\\c_2a_{2,1}+\cdots+c_na_{2,n}\\\vdots\\c_na_{m,1}+\cdots+c_na_{m,n}\end{pmatrix}

If the number of columns in the matrix is not equal to the number of rows in the vector, the product is not defined.

Example 9.2

Find the product of
(324253)(123)\begin{pmatrix}3&2&4\\2&5&3\end{pmatrix}\begin{pmatrix}1\\2\\3\end{pmatrix}


(324253)(123)=(3(1)+2(2)+4(3)2(1)+5(2)+3(3))=(1921)\begin{pmatrix}3&2&4\\2&5&3\end{pmatrix}\begin{pmatrix}1\\2\\3\end{pmatrix}=\begin{pmatrix}3(1)+2(2)+4(3)\\2(1)+5(2)+3(3)\end{pmatrix}=\begin{pmatrix}19\\21\end{pmatrix}

Similarly, we can show that a matrix can be represented by a linear map.
For a given matrix HH, determine its effect on a vector v\vec{v} and show that the map is linear.


Quick Summary

A linear map h:VWh:V\to W is

If h:VWh:V\to W is a linear map and dim V=dim W\text{dim }V=\text{dim }W, the following are equivalent

Matrix-vector product is used to change basis
RepB,D(h)RepB(v)=RepD(h(v))\text{Rep}_{B,D}(h)\cdot\text{Rep}_B(\vec{v})=\text{Rep}_D(h(\vec{v}))


Studying Matrices

(123456)(xyz)=(ab)\begin{pmatrix}1&2&3\\4&5&6\end{pmatrix}\begin{pmatrix}x\\y\\z\end{pmatrix}=\begin{pmatrix}a\\b\end{pmatrix}
The number of columns of HH is the dimension of hh's domain and
the number of rows of HH is the dimension of hh's codomain

h:VWh:V\to W is the zero map v0\vec{v}\mapsto\vec{0} if it is represented by the zero matrix for any basis

The rank of a matrix equals the rank of any map it represents

Proof

Suppose matrix HH is m×nm\times n. Fix domain and codomain spaces VV and WW of dimension nn and mm with basis B=β1,...,βnB=\langle\vec{\beta}_1,...,\vec{\beta}_n\rangle and DD. Then HH represents some linear map hh whose range space is the span of {h(β1),...,h(βn)}\{h(\vec{\beta}_1),...,h(\vec{\beta}_n)\}. The rank of map hh is the dimension of this range space.
The rank of the matrix is the rank of the column space, the span of {RepD(h(β1)),...,RepD(h(βn))}\{\text{Rep}_D(h(\vec{\beta}_1)),...,\text{Rep}_D(h(\vec{\beta}_n))\}
Next check if the dimensions are equal.
Under the isomorphism RepD:WRm\text{Rep}_D:W\mathbb{R}^m, 0=c1h(β1)++cnh(βn)\vec{0}=c_1\cdot h(\vec{\beta}_1)+\cdots+c_n\cdot h(\vec{\beta}_n) iff 0=c1RepD(h(β1))++cnRepD(h(βn))\vec{0}=c_1\cdot\text{Rep}_D(h(\vec{\beta}_1))+\cdots+c_n\cdot\text{Rep}_D(h(\vec{\beta}_n)).
Therefore, the size of the largest linearly independent subset of the range space equals the size of the largest linearly independent subset of the column space, so the two spaces have the same dimension.

Let h:VWh:V\to W be a linear map represented by matrix HH. Then:
hh is onto iff rank(h)\text{rank}(h) = number of rows
hh is one-to-one iff rank(h)\text{rank}(h) = number of columns

Proof

For onto half:
rank(h)=rank(H)\text{rank}(h)=\text{rank}(H) by previous theorem
dimension of WW = number of rows in HH
So
rank(h)\text{rank}(h) = number of rows dim(R(h))=dim(W)\implies\text{dim}(\mathscr{R}(h))=\text{dim}(W)
But R(h)dim(W)\mathscr{R}(h)\subseteq\text{dim}(W), so if their dimensions are equal, they msut be equal sets.
The range space covers the entire codomain, so hh is onto.

For one-to-one half:
A linear map is one-to-one iff dim(V)=dim(R(h))\text{dim}(V)=\text{dim}(\mathscr{R}(h))
The dimension of the domain is the number of columns of HH and by the theorem the rank of HH equals the dimension of R(h)\mathscr{R}(h)

A linear map that is bijective is nonsingular and otherwise it is singular
A nonsingular linear map is represented by a square matrix.
A square matrix represents a nonsingular matrix iff it is a nonsingular matrix.
\rightarrow a matrix represents an isomorphism iff it is square and nonsingular

Proof

Assume h:VWh:V\to W is nonsingular. Then for a matrix HH, because hh is one-to-one and onto, the number of rows equals the number of columns equals the rank of HH, so it is square.
Next assume HH is a square n×nn\times n matrix.
Matrix HH is nonsingular \iff row rank is nn\iffHH's rank is nn\iffhh's rank is nn, \iffhh is an isomorphism (dimension of domain and codomain are both nn).

Example 9.3

The matrix
(0312)\begin{pmatrix}0&3\\-1&2\end{pmatrix}
is nonsingular (we can check by Gauss's Method or seeing that the rows are linearly indepenedent), so any map represented by this matrix is an isomorphism.

The matrix
(212321105)\begin{pmatrix}2&1&-2\\3&2&1\\-1&0&5\end{pmatrix}
is singular (ρ22ρ1=ρ3\rho_2-2\rho_1=\rho_3), so a map represented by this matrix is a homomorphism that isn't an isomorphism.

To compute range and null space:
represent the map as
H=RepEn,En(h)H=\text{Rep}_{\mathcal{E}_n,\mathcal{E}_n}(h)
The map can then be represented as
RepEn,En(h)RepEn(v)=RepEn(h(v))\text{Rep}_{\mathcal{E}_n,\mathcal{E}_n}(h)\cdot\text{Rep}_{\mathcal{E}_n}(\vec{v})=\text{Rep}_{\mathcal{E}_n}(h(\vec{v}))
If the map is onto, then there must be a solution for any RepEn(h(v))\text{Rep}_{\mathcal{E}_n}(h(\vec{v})).
Row reduce to check.
If the map is one-to-one, the associated homogeneous system should only have the trivial solution.

Example 9.4

Consider the map h:R3R3h:\mathbb{R}^3\to\mathbb{R}^3
(xyz)h(xx+zxz)\begin{pmatrix}x\\y\\z\end{pmatrix}\xmapsto{h}\begin{pmatrix}x\\x+z\\x-z\end{pmatrix}
The basis vectors get mapped to
(100)h(111)(010)h(000)(001)h(011)\begin{array}{ccc}\begin{pmatrix}1\\0\\0\end{pmatrix}\xmapsto{h}\begin{pmatrix}1\\1\\1\end{pmatrix}&\begin{pmatrix}0\\1\\0\end{pmatrix}\xmapsto{h}\begin{pmatrix}0\\0\\0\end{pmatrix}&\begin{pmatrix}0\\0\\1\end{pmatrix}\xmapsto{h}\begin{pmatrix}0\\1\\-1\end{pmatrix}\end{array}
The matrix representing this map is thus
(100101101)\begin{pmatrix}1&0&0\\1&0&1\\1&0&-1\end{pmatrix}
The mapping can be represented by this equation for input vector (xyz)\begin{pmatrix}x\\y\\z\end{pmatrix} and output vector (abc)\begin{pmatrix}a\\b\\c\end{pmatrix}
(100101101)(xyz)=(abc)\begin{pmatrix}1&0&0\\1&0&1\\1&0&-1\end{pmatrix}\begin{pmatrix}x\\y\\z\end{pmatrix}=\begin{pmatrix}a\\b\\c\end{pmatrix}
First check if there is a solution for any a,b,ca,b,c
(100a101b101c)(100a001a+b0002a+b+c)\left(\begin{array}{ccc|c}1&0&0&a\\1&0&1&b\\1&0&-1&c\end{array}\right)\sim\left(\begin{array}{ccc|c}1&0&0&a\\0&0&1&-a+b\\0&0&0&-2a+b+c\end{array}\right)
This only has a solution if b+c=2ab+c=2a, so this is not onto.
In particular, the range space R(h)={t(1/210)+s(1/201)  t,sR}\mathscr{R}(h)=\left\{t\begin{pmatrix}1/2\\1\\0\end{pmatrix}+s\begin{pmatrix}1/2\\0\\1\end{pmatrix}\space|\space t,s\in\mathbb{R}\right\}
The associated homogeneous system is when a=b=c=0a=b=c=0, so the matrix is
(100000100000)\left(\begin{array}{ccc|c}1&0&0&0\\0&0&1&0\\0&0&0&0\end{array}\right)
The solution set is non trivial, so it is not one-to-one.
In particular, the null space N(h)={t(010) | tR}\mathscr{N}(h)=\left\{t\begin{pmatrix}0\\1\\0\end{pmatrix}\space\middle|\space t\in\mathbb{R}\right\}

Example 9.5

Consider the map hh represented by
H=(121230)H=\begin{pmatrix}1&2&1\\2&3&0\end{pmatrix}
This takes a 3-dimensional input and a 2-dimensional output, so for any a,ba,b,
(121a230b)(1033a+2b0122ab)\left(\begin{array}{ccc|c}1&2&1&a\\2&3&0&b\end{array}\right)\sim\left(\begin{array}{ccc|c}1&0&-3&-3a+2b\\0&1&2&2a-b\end{array}\right)
Since there clearly exists an input that maps to a,ba,b, so this is onto.
To see if it is one-to-one, plug in a=b=0a=b=0 and we get the solution set
{(321)z | zR}\left\{\begin{pmatrix}3\\-2\\1\end{pmatrix}z\space\middle|\space z\in\mathbb{R}\right\}
There is more than one solution, so it is not one-to-one
This is the nullspace; its dimension is 1. This could be determined by the fact that the output is 2-dimensional, so rank(h)=2\text{rank}(h)=2, meaning the nullity is 32=13-2=1.